-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Clear where non-American English appears #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear where non-American English appears #209
Conversation
Can you simplify the lengthy script? |
Which formatter is this script using? |
I have not decided yet. You can simply follow the existing indention. |
Should I squash my local commits into a single commit and then force push, or simply add a new commit? |
Always squash for single purpose commits. |
Previously, warnings about non-American English words in commit messages did not indicate the specific word or its exact location. This commit improves the hook by outputting the precise line number and word that triggered the warning. A new function, 'get_all_match_positions', was introduced to locate the first occurrence of each target word in a multi-line string. We now preserve blank lines in the commit message by using the variable 'FULL_COMMIT_MSG_WITH_SPACE', so that the line search functionality operates correctly. This change makes it easier for users to quickly identify and correct non-American English words in their commit messages. Change-Id: I8a2b7eb3984b06b0be6506ca4f410ca857fe50a7
8a2428c
to
d39d920
Compare
Thank @Dennis40816 for contributing! |
PR sysprog21#209's functionality was broken due to changes introduced in PR sysprog21#214, specifically in commit '4a8d8b5', where some occurrences of 'COMMIT_MSG_LINES' were replaced with 'commit_msg_lines' without updating all relevant functions. This commit fixes the issue by replacing all instances of 'COMMIT_MSG_LINES' with 'commit_msg_lines', ensuring consistency and restoring the functionality introduced in PR sysprog21#209. Change-Id: I0c93617be83c5f24b1e17678566883c0481ddc48
This PR improves the hook that detects non-American English in commit messages.
Previously, the hook would only indicate the presence of non-American English words without specifying their locations or the words themselves. Now, the hook clearly reports the exact line numbers and problematic words, making it easier for users to identify and correct the issues.
A test is conducted below.
Before
After